package com.zxjbyte.yiyi.extension.job.controller;

import com.zxjbyte.yiyi.extension.job.service.JobLogService;
import com.zxjbyte.yiyi.framework.common.constant.Constant;
import com.zxjbyte.yiyi.framework.common.domain.api.PageResult;
import com.zxjbyte.yiyi.extension.job.domain.vo.JobLogPageVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author zhangxingjia
 * @Date 2023/10/10 15:48
 * @Version: 1.0
 */
@Slf4j
@Tag(name = "定时任务日志")
@RestController
@RequestMapping(value = Constant.BASE_PATH_EXTENSION + "/malljob/log")
public class JobLogController {

    @Resource
    private JobLogService jobLogService;

    @Operation(summary = "任务日志分页查询")
    @GetMapping("/page")
    public PageResult<JobLogPageVO> page(@Parameter(description = "状态：1-成功，2-失败")
                                                   @RequestParam(value = "status", required = false) Integer status){
        return jobLogService.page(status);
    }
}
